import axios from "../request"
import qs from 'qs'
// export const JingPin = () => axios.get('/products/recommend', { headers: { 'X-Custom-Header': 'mytoken' } })  // 要登录权限的页面，每个都要在请求接口时 配置请求头，携带 token，要配置次数多、繁琐，所以放在请求拦截器配置，一次配置，终生享用
// 精品推荐数据
export const JingPinApi = () => axios.get('/products/recommend',)

// 热门兑换数据
export const ReMenApi = () => axios.get("/products/hot",)

// 短信验证码接口
// export const getCodeApi = (params) => axios.post('/sendSMS', params)
export const getCodeApi = (params) => axios.post('/sendSMS', qs.stringify(params))

// 手机号登录接口
export const phoneLoginApi = (params) => axios.post("/phoneRegin", qs.stringify(params))

// 微信扫码登录
export const weiXinLoginApi = (params) => axios.post("/wechatUsers/PCLogin", qs.stringify(params))

// 手机号绑定微信请求
export const wechatBindingPhoneApi = (params) => axios.post("/wechatUsers/binding", qs.stringify(params))

// 获取用户信息
export const getUserInfoApi = () => axios.get("/shop/userProfiles")

// 商品详情
export const merchandiseDetailsApi = (id) => axios.get(`/products/${id}`)